package com.example.carbonbackend.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.example.carbonbackend.model.dto.trade.TradeQueryRequest;
import com.example.carbonbackend.model.entity.Trade;
import com.example.carbonbackend.model.vo.TradeVO;

import javax.servlet.http.HttpServletRequest;


/**
* @author b'j'x
* @description 针对表【Trade(交易记录表)】的数据库操作Service
* @createDate 2024-03-25 20:15:44
*/
public interface TradeService extends IService<Trade> {



    /**
     * 获取查询条件
     *
     * @param tradeQueryRequest
     * @return
     */
    QueryWrapper<Trade> getQueryWrapper(TradeQueryRequest tradeQueryRequest);

    /**
     * 获取交易记录封装
     *
     * @param trade
     * @param request
     * @return
     */
    TradeVO getTradeVO(Trade trade, HttpServletRequest request);

    /**
     * 分页获取交易记录封装
     *
     * @param tradePage
     * @param request
     * @return
     */
    Page<TradeVO> getTradeVOPage(Page<Trade> tradePage, HttpServletRequest request);

}
